package util;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;

import parameter.*;

public class komoranUserDataGen {
	
	public static void main(String args[]) throws Exception{
		
		FileWriter fileWriter = new FileWriter(Path.WIKIPEDIA_PATH + "dic.user");
		BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

		FileReader fileReader = new FileReader(new File(Path.WIKIPEDIA_ALL_TITLES_FILEPATH));
		BufferedReader bufferedReader = new BufferedReader(fileReader);
		String line = "";
		while (true) {
			line = bufferedReader.readLine();
			if (line == null){
				break;
			}else if(!line.trim().equals("")){
				bufferedWriter.write(line.replaceAll("_", " ").trim() + "\t" + "NNP");
				bufferedWriter.newLine();
			}
		}
		bufferedWriter.close();
		fileWriter.close();
		
		bufferedReader.close();
		fileReader.close();
		System.out.println("complete");

	}

}
